 <script language="javascript">
	function goback(){
		document.forms[0].action='<?=site_url("misc/homepage")?>';
		document.forms[0].submit();
	}
	function goaddnewannounce(){
		document.forms[0].action='<?=site_url("job_management/goto_addnew_announ")?>';
		document.forms[0].submit();
	}
	function deleteannounce(deleteid){
		if(confirm("Do you want to delete?","Delete data")){
			document.forms[0].action='<?=site_url("job_management/delete_announ")?>/'+ deleteid ;
			document.forms[0].submit();
		}
	}
	function searchresult(){
		document.forms[0].action='<?=site_url("job_management/search_result")?>';
		document.forms[0].submit();
	}
</script>
	<h3 class="capture">Job Management</h3>
    <div id="wrap">
    <div id="tdd_selected">
    	<div class="dd_selected">Announcement</div>
        <div class="dd_view"><br />
        <form action="" method="post">
        <div><!-- company combobox -->
        	Company:<select id="cbocompany" name="cbocompany">
            	<option value="All">All</option>
                <?php foreach($all_company->result() as $company): ?>
                <option value="<?=$company->com_id;?>"><?=$company->com_name;?></option>
                <?php endforeach; ?>
            </select>
            <input type="button" name="btnsearch" value="Search" onclick="searchresult()" />
        </div>
        	<table width="600" border="0" align="center" cellpadding="0" cellspacing="0" class="userview">
        		<tr>
        			<th>Announce Id</th>
        			<th>Company</th>
        			<th>Post Date</th>
        			<th>Closing Date</th>
        			<th>Number Titles</th>
        			<th>Delete</th>
        		</tr>
        		 
        		<?php foreach($all_announce->result() as $announce): ?>
                  <tr onmouseover="this.style.backgroundColor='#ffff66';" onmouseout="this.style.backgroundColor='#d4e3e5';">
                    <td><a href="<?=site_url("job_management/goto_update_announ/$announce->com_id/$announce->announ_id")?>"><?=htmlspecialchars($announce->announ_id);?></a></td>
                   	<td><?=htmlspecialchars($announce->com_name);?></td>
                    <td><?=htmlspecialchars($announce->date_post);?></td>
                    <td><?=htmlspecialchars($announce->date_close);?></td>
                    <?php $an=$this->m_job->get_number_title($announce->announ_id); ?>
                    <td><a href="<?=site_url("job_management/goto_title_view/$announce->com_id/$announce->announ_id")?>"><?=count($an->result());?></a></td>
                    <td align="center"><img src="<?=base_url();?>images/recyclebin.png" width="20px" height="20px" onclick="deleteannounce('<?=$announce->announ_id;?>')" /></td>
                  </tr>
              	<?php endforeach; ?>
            </table><br />
           <div align="center">
	           <input type="button" name="btnback" value="Back" class="bottom" onclick="goback()" />
	           <input type="button" name="btnaddnew" class="bottom" value="Add New" onclick="goaddnewannounce()" />
	       </div><br />
        </form>
		</div>
        
    </div> 
      
  </div>


